package org.util.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BaseTag extends TagSupport {
	private static final long serialVersionUID = 8490632896020939113L;

	@Override
	public int doStartTag() throws JspException {
		return super.doStartTag();
	}

	/**
	 * 获得spring文件当中的bean对象;
	 * 
	 * @param xmlPath
	 * @param obj
	 * @return
	 */
	public Object getBean(String xmlPath, String obj) {
		ApplicationContext ac = new ClassPathXmlApplicationContext(xmlPath);
		Object object = ac.getBean(obj);
		return object;
	}

}
